class FilePack:
    
    def Pack(files: list[bytes]) -> bytes:
        countHeader = len(files).to_bytes(4, byteorder="big")
        lengthes = [len(file).to_bytes(4, byteorder="big") for file in files]
        result = bytearray()
        result.extend(countHeader)
        for length_bytes, file in zip(lengthes, files):
            result.extend(length_bytes)
            result.extend(file)
        return result

    def Unpack( data: bytes) -> list[bytes]:
        countHeader = int.from_bytes(data[:4], byteorder="big")
        offset = 4
        files = []
        for _ in range(countHeader):
            length = int.from_bytes(data[offset : offset + 4], byteorder="big")
            offset += 4
            file_data = data[offset : offset + length]
            offset += length
            files.append(file_data)
        return files
